package com.ln.spring4X.configAndComponent;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class HumanConfiguration {

    @Bean("getWomanByConfiguration")
    public Woman getWomanByConfiguration() {
        Woman woman = new Woman();
        // 直接调用@Bean注解的方法方法getChildBean()
        woman.setChild(getChildByConfiguration());
        return woman;
    }

    @Bean("getChildByConfiguration")
    public Child getChildByConfiguration() {
        return new Child();
    }
    
}
